<template>
	<!-- 城市选择 -->
	<view><chose-city @selectCity="selectCity" v-if="showCity" @closeModal="closeModal"></chose-city></view>
</template>

<script>
import choseCity from '@/components/chose-city/chose-city'
export default {
	components: {
		choseCity
	},
	data() {
		return {
			showCity: true,
			mydata: {
				citycode: '',
				city: ''
			}
		}
	},
	methods: {
		selectCity(item) {
			console.log('-您选择的城市-', item)
			//带数据返回上一页
			this.mydata.city = item.name
			this.mydata.citycode = item.citycode
			uni.$emit('updateData', this.mydata)
			uni.navigateBack({
				delta: 1
			})
			// this.showCity = false
		},
		closeModal() {
			this.showCity = false
		}
	}
}
</script>

<style></style>
